package com.yeyks.common.appcommon.result;

import com.yeyks.common.appcommon.dto.account.AppAccountDTO;
import lombok.extern.slf4j.Slf4j;

/**
 * 账号相关信息存取
 * @author: dagny
 * @date: 2019/6/27 0027 15:14
 */
@Slf4j
public class ThreadLocalUtil {

    private static final ThreadLocal<AppAccountDTO> userLogin = new ThreadLocal<>();

    public static void setAccount(AppAccountDTO accountDTO){
        userLogin.set(accountDTO);
    }

    public static void removeAccount(){
        userLogin.remove();
    }

    public static AppAccountDTO getAccount(){

        return userLogin.get();
    }

}
